@@ -43,7 +43,6 @@ gem 'em-http-request' |
||
43 | 43 |
gem 'weibo_2' |
44 | 44 |
|
45 | 45 |
gem 'xmpp4r', '~> 0.5.6' |
46 |
-gem 'mustache', '~> 0.99.5' |
|
47 | 46 |
|
48 | 47 |
gem 'therubyracer' |
49 | 48 |
|
@@ -158,7 +158,6 @@ GEM |
||
158 | 158 |
multi_json (1.7.9) |
159 | 159 |
multi_xml (0.5.5) |
160 | 160 |
multipart-post (2.0.0) |
161 |
- mustache (0.99.5) |
|
162 | 161 |
mysql2 (0.3.13) |
163 | 162 |
naught (1.0.0) |
164 | 163 |
nokogiri (1.6.0) |
@@ -330,7 +329,6 @@ DEPENDENCIES |
||
330 | 329 |
jsonpath |
331 | 330 |
kaminari |
332 | 331 |
kramdown |
333 |
- mustache (~> 0.99.5) |
|
334 | 332 |
mysql2 |
335 | 333 |
nokogiri |
336 | 334 |
pry |
@@ -1,4 +1,3 @@ |
||
1 |
-require 'mustache' |
|
2 | 1 |
module Agents |
3 | 2 |
class JabberAgent < Agent |
4 | 3 |
cannot_be_scheduled! |
@@ -11,7 +10,7 @@ module Agents |
||
11 | 10 |
|
12 | 11 |
The `message` is sent from `jabber_sender` to `jaber_receiver`. This message |
13 | 12 |
can contain any keys found in the source's payload, escaped using double curly braces. |
14 |
- ex: `"News Story: {{title}}: {{url}}"` |
|
13 |
+ ex: `"News Story: <$.title>: <$.url>"` |
|
15 | 14 |
MD |
16 | 15 |
|
17 | 16 |
def default_options |
@@ -59,7 +58,7 @@ module Agents |
||
59 | 58 |
end |
60 | 59 |
|
61 | 60 |
def body(event) |
62 |
- Mustache.render(options['message'], event.payload) |
|
61 |
+ Utils.interpolate_jsonpaths(options['message'], event.payload) |
|
63 | 62 |
end |
64 | 63 |
end |
65 | 64 |
end |
@@ -9,7 +9,7 @@ describe Agents::JabberAgent do |
||
9 | 9 |
jabber_sender: 'foo@localhost', |
10 | 10 |
jabber_receiver: 'bar@localhost', |
11 | 11 |
jabber_password: 'password', |
12 |
- message: 'Warning! {{title}} - {{url}}', |
|
12 |
+ message: 'Warning! <$.title> - <$.url>', |
|
13 | 13 |
expected_receive_period_in_days: '2' |
14 | 14 |
} |
15 | 15 |
} |